package com.yanqu.road.server.cmd.activity.pawnshop;

import com.yanqu.road.pb.activity.PawnshopProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.activity.pawnshop.PawnshopMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

import java.util.List;

@Cmd(code = GameProtocol.S_PAWNSHOP_SYNC_CROSS_TRIGGER,desc = "")
public class CrossSyncTriggerDataCmd implements Command {
    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        PawnshopProto.PawnshopSyncTriggerMsg msg = PawnshopProto.PawnshopSyncTriggerMsg.parseFrom(packet.getBytes());
        int activityId = msg.getActivityId();
        List<PawnshopProto.PawnshopTriggerDataMsg> dataList = msg.getDataList();
        PawnshopMgr.syncTriggerData(activityId,dataList);
    }
}
